package top.andnux.memoryleak.case1_singleton;

import android.content.Context;
import android.os.Handler;

public class Singleton {

    private static Singleton ourInstance;

    public static Singleton getInstance(Context context) {
        if (ourInstance == null) {
            Context applicationContext = context.getApplicationContext();
            ourInstance = new Singleton(applicationContext);
        }
        return ourInstance;
    }

    private Context mContext;

    private Singleton(Context context) {
        mContext = context;
    }
}
